package com.nian.images.api;

import com.nian.common.model.ServerResponse;
import com.nian.images.model.ImagesApp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 用途：
 * 开发：zhangmj
 * 日期：2020/3/31 0031 20:31
 */
@FeignClient(value = "nian-images-service", path = "/images", fallback = ImagesAppAPIHystrix.class)
public interface ImagesAppAPI {

    @GetMapping("/getUrls/{imagesType}/{imagesIds}")
    ServerResponse<List<ImagesApp>> getUrls(@PathVariable("imagesType") Integer imagesType, @PathVariable("imagesIds") String imagesIds);

    @GetMapping("/getUrl/{imagesType}/{imagesId}")
    ServerResponse<ImagesApp> getUrl(@PathVariable("imagesType") Integer imagesType, @PathVariable("imagesId") Long imagesId);

    @GetMapping("/getImage/{imagesType}/{imagesId}")
    ImagesApp getImage(@PathVariable("imagesType") Integer imagesType, @PathVariable("imagesId") Long imagesId);

    @GetMapping("/list/{imagesType}/{imagesIds}")
    List<ImagesApp> list(@PathVariable("imagesType") Integer imagesType, @PathVariable("imagesIds") String imagesIds);
}
